<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="所在机构">
              <j-select-depart
                v-model="queryParam.id"
                :trigger-change="true"
                customReturnField="id"
                :multi="true"
              ></j-select-depart>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
            <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">清除条件</a-button>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
      <template slot="interiorAuditNum" slot-scope="text, record">
        <a @click="goPage('sjzyzhgl-sjrygl', 1, record.id, record.name)">{{ text }}</a>
      </template>
      <template slot="externalAuditNum" slot-scope="text, record">
        <a @click="goPage('sjzyzhgl-sjrygl', 2, record.id, record.name)">{{ text }}</a>
      </template>
      <template slot="expertAuditNum" slot-scope="text, record">
        <a @click="goPage1('sjzyzhgl-sjzjgl', record.id, record.name)">{{ text }}</a>
      </template>
      <template slot="externalAuditOrgNum" slot-scope="text, record">
        <a @click="goPage2('sjzyzhgl-wbsjjggl', record.id, record.name)">{{ text }}</a>
      </template>
      <span slot="action" slot-scope="text, record">
        <span v-has="'dept:detail'">
          <a @click="handleCheck(record, '审计机构管理-查看')">查看</a>
        </span>
      </span>
    </a-table>
    <!-- table区域-end -->
    <CheckModel ref="modalForm"></CheckModel>
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CheckModel from './CheckModel'
import columns from './indexColumns'

export default {
  name: 'sjjggl',
  mixins: [JeecgListMixin],
  components: {
    CheckModel,
  },
  data() {
    return {
      queryParam: {},
      // 表头
      columns: columns(this),
      url: {
        list: '/sjzyzhgl/sjAuditOrg/list',
      },
    }
  },
  computed: {},
  methods: {
    goPage(routerName, category, unit, unitText) {
      this.$router.push({ name: routerName, params: { category: category, unit: unit, unitText: unitText } })
    },
    goPage1(routerName, unit, unitText) {
      this.$router.push({ name: routerName, params: { unit: unit, unitText: unitText } })
    },
    goPage2(routerName, unit, unitText) {
      this.$router.push({ name: routerName, params: { unit: unit, unitText: unitText } })
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>